package nav

/*
#include<stdint.h>
#include<stdbool.h>
extern unsigned int nav_FastLZCompressor_compress(void * c_this,void * buffer,int bufferSize,void * compressed,int tmp_arg3,void * compressedSize);
extern unsigned int nav_FastLZCompressor_decompress(void * c_this,void * compressed,int compressedSize,void * buffer,int maxBufferSize,void * bufferSize);
extern void nav_FastLZCompressor_Delete(void * c_this);
extern void nav_FastLZCompressor_DeleteArray(void * c_this);
extern void* nav_NewFastLZCompressor();
extern void * nav_FastLZCompressor_IndexArray(void * c_this,long n);
extern int nav_FastLZCompressor_maxCompressedSize(void * c_this,int bufferSize);
extern void * nav_LinearAllocator_alloc(void * c_this,unsigned long long size);
extern void nav_LinearAllocator_Delete(void * c_this);
extern void nav_LinearAllocator_DeleteArray(void * c_this);
extern void nav_LinearAllocator_free(void * c_this,void * tmp_arg0);
extern void * nav_LinearAllocator_GetPtrToBuffer(void * c_this);
extern void * nav_LinearAllocator_GetPtrToCapacity(void * c_this);
extern void * nav_LinearAllocator_GetPtrToHigh(void * c_this);
extern void * nav_LinearAllocator_GetPtrToTop(void * c_this);
extern void * nav_LinearAllocator_IndexArray(void * c_this,long n);
extern void* nav_NewLinearAllocator(unsigned long long cap);
extern void nav_LinearAllocator_reset(void * c_this);
extern void nav_LinearAllocator_resize(void * c_this,unsigned long long cap);
extern void nav_MeshProcess_Delete(void * c_this);
extern void nav_MeshProcess_DeleteArray(void * c_this);
extern void * nav_MeshProcess_GetPtrToM_geom(void * c_this);
extern void * nav_MeshProcess_IndexArray(void * c_this,long n);
extern void nav_MeshProcess_init(void * c_this,void * geom);
extern void* nav_NewMeshProcess();
extern void nav_MeshProcess_process(void * c_this,void * params,void * polyAreas,void * polyFlags);
extern void * nav_NewFastLZCompressorPtrArray(long n);
extern void * nav_NewMeshProcessPtrArray(long n);

*/
import "C"
import "unsafe"
import "gitee.com/hasika/cgo"

var _ unsafe.Pointer
var _ cgo.NotUsed

type FastLZCompressorPtr uintptr

func (p FastLZCompressorPtr) AsDtTileCacheCompressorPtr() DtTileCacheCompressorPtr {
	return DtTileCacheCompressorPtr(p)
}

/*
public virtual dtStatus compress(unsigned char const * buffer, int const bufferSize, unsigned char * compressed, int const tmp_arg3, int * compressedSize)
*/
func (p FastLZCompressorPtr) Compress(buffer *uint8, bufferSize int32, compressed *uint8, tmp_arg3 int32, compressedSize *int32) uint32 {
	var wrap_this unsafe.Pointer
	var wrap_arg_buffer unsafe.Pointer
	var wrap_arg_bufferSize C.int
	var wrap_arg_compressed unsafe.Pointer
	var wrap_arg_tmp_arg3 C.int
	var wrap_arg_compressedSize unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_arg_buffer = (unsafe.Pointer)(buffer)
	wrap_arg_bufferSize = (C.int)(bufferSize)
	wrap_arg_compressed = (unsafe.Pointer)(compressed)
	wrap_arg_tmp_arg3 = (C.int)(tmp_arg3)
	wrap_arg_compressedSize = (unsafe.Pointer)(compressedSize)
	wrap_out := C.nav_FastLZCompressor_compress(wrap_this, wrap_arg_buffer, wrap_arg_bufferSize, wrap_arg_compressed, wrap_arg_tmp_arg3, wrap_arg_compressedSize)
	go_out := uint32(wrap_out)
	return go_out
}

/*
public virtual dtStatus decompress(unsigned char const * compressed, int const compressedSize, unsigned char * buffer, int const maxBufferSize, int * bufferSize)
*/
func (p FastLZCompressorPtr) Decompress(compressed *uint8, compressedSize int32, buffer *uint8, maxBufferSize int32, bufferSize *int32) uint32 {
	var wrap_this unsafe.Pointer
	var wrap_arg_compressed unsafe.Pointer
	var wrap_arg_compressedSize C.int
	var wrap_arg_buffer unsafe.Pointer
	var wrap_arg_maxBufferSize C.int
	var wrap_arg_bufferSize unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_arg_compressed = (unsafe.Pointer)(compressed)
	wrap_arg_compressedSize = (C.int)(compressedSize)
	wrap_arg_buffer = (unsafe.Pointer)(buffer)
	wrap_arg_maxBufferSize = (C.int)(maxBufferSize)
	wrap_arg_bufferSize = (unsafe.Pointer)(bufferSize)
	wrap_out := C.nav_FastLZCompressor_decompress(wrap_this, wrap_arg_compressed, wrap_arg_compressedSize, wrap_arg_buffer, wrap_arg_maxBufferSize, wrap_arg_bufferSize)
	go_out := uint32(wrap_out)
	return go_out
}

/*
public virtual void Delete()
*/
func (p FastLZCompressorPtr) Delete() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_FastLZCompressor_Delete(wrap_this)
}

/*
void DeleteArray()
*/
func (p FastLZCompressorPtr) DeleteArray() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_FastLZCompressor_DeleteArray(wrap_this)
}

/*
public FastLZCompressor()
*/
func NewFastLZCompressor() cgo.GoManagedPtr[FastLZCompressorPtr] {
	wrap_out := C.nav_NewFastLZCompressor()
	go_out := cgo.MakePtr[cgo.GoManagedPtr[FastLZCompressorPtr]](uintptr(wrap_out))
	return go_out
}

/*
FastLZCompressor * IndexArray(long n)
*/
func (p FastLZCompressorPtr) IndexArray(n int) uintptr {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_FastLZCompressor_IndexArray(wrap_this, C.long(n))
	go_out := uintptr(wrap_out)
	return go_out
}

/*
public virtual int maxCompressedSize(int const bufferSize)
*/
func (p FastLZCompressorPtr) MaxCompressedSize(bufferSize int32) int32 {
	var wrap_this unsafe.Pointer
	var wrap_arg_bufferSize C.int
	wrap_this = unsafe.Pointer(p)
	wrap_arg_bufferSize = (C.int)(bufferSize)
	wrap_out := C.nav_FastLZCompressor_maxCompressedSize(wrap_this, wrap_arg_bufferSize)
	go_out := int32(wrap_out)
	return go_out
}

type LinearAllocatorPtr uintptr

func (p LinearAllocatorPtr) AsDtTileCacheAllocPtr() DtTileCacheAllocPtr {
	return DtTileCacheAllocPtr(p)
}

/*
public virtual void * alloc(size_t const size)
*/
func (p LinearAllocatorPtr) Alloc(size uint64) uintptr {
	var wrap_this unsafe.Pointer
	var wrap_arg_size C.ulonglong
	wrap_this = unsafe.Pointer(p)
	wrap_arg_size = (C.ulonglong)(size)
	wrap_out := C.nav_LinearAllocator_alloc(wrap_this, wrap_arg_size)
	go_out := (uintptr)(unsafe.Pointer(wrap_out))
	return go_out
}

/*
public virtual void Delete()
*/
func (p LinearAllocatorPtr) Delete() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_LinearAllocator_Delete(wrap_this)
}

/*
void DeleteArray()
*/
func (p LinearAllocatorPtr) DeleteArray() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_LinearAllocator_DeleteArray(wrap_this)
}

/*
public virtual void free(void * tmp_arg0)
*/
func (p LinearAllocatorPtr) Free(tmp_arg0 uintptr) {
	var wrap_this unsafe.Pointer
	var wrap_arg_tmp_arg0 unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_arg_tmp_arg0 = (unsafe.Pointer)(tmp_arg0)
	C.nav_LinearAllocator_free(wrap_this, wrap_arg_tmp_arg0)
}

/*
public unsigned char * * GetPtrToBuffer()
*/
func (p LinearAllocatorPtr) GetPtrToBuffer() **uint8 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_LinearAllocator_GetPtrToBuffer(wrap_this)
	go_out := (**uint8)(unsafe.Pointer(wrap_out))
	return go_out
}

/*
public size_t * GetPtrToCapacity()
*/
func (p LinearAllocatorPtr) GetPtrToCapacity() *uint64 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_LinearAllocator_GetPtrToCapacity(wrap_this)
	go_out := (*uint64)(unsafe.Pointer(wrap_out))
	return go_out
}

/*
public size_t * GetPtrToHigh()
*/
func (p LinearAllocatorPtr) GetPtrToHigh() *uint64 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_LinearAllocator_GetPtrToHigh(wrap_this)
	go_out := (*uint64)(unsafe.Pointer(wrap_out))
	return go_out
}

/*
public size_t * GetPtrToTop()
*/
func (p LinearAllocatorPtr) GetPtrToTop() *uint64 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_LinearAllocator_GetPtrToTop(wrap_this)
	go_out := (*uint64)(unsafe.Pointer(wrap_out))
	return go_out
}

/*
LinearAllocator * IndexArray(long n)
*/
func (p LinearAllocatorPtr) IndexArray(n int) uintptr {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_LinearAllocator_IndexArray(wrap_this, C.long(n))
	go_out := uintptr(wrap_out)
	return go_out
}

/*
public LinearAllocator(size_t const cap)
*/
func NewLinearAllocator(cap uint64) cgo.GoManagedPtr[LinearAllocatorPtr] {
	var wrap_arg_cap C.ulonglong
	wrap_arg_cap = (C.ulonglong)(cap)
	wrap_out := C.nav_NewLinearAllocator(wrap_arg_cap)
	go_out := cgo.MakePtr[cgo.GoManagedPtr[LinearAllocatorPtr]](uintptr(wrap_out))
	return go_out
}

/*
public virtual void reset()
*/
func (p LinearAllocatorPtr) Reset() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_LinearAllocator_reset(wrap_this)
}

/*
public void resize(size_t const cap)
*/
func (p LinearAllocatorPtr) Resize(cap uint64) {
	var wrap_this unsafe.Pointer
	var wrap_arg_cap C.ulonglong
	wrap_this = unsafe.Pointer(p)
	wrap_arg_cap = (C.ulonglong)(cap)
	C.nav_LinearAllocator_resize(wrap_this, wrap_arg_cap)
}

type MeshProcessPtr uintptr

func (p MeshProcessPtr) AsDtTileCacheMeshProcessPtr() DtTileCacheMeshProcessPtr {
	return DtTileCacheMeshProcessPtr(p)
}

/*
public virtual void Delete()
*/
func (p MeshProcessPtr) Delete() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_MeshProcess_Delete(wrap_this)
}

/*
void DeleteArray()
*/
func (p MeshProcessPtr) DeleteArray() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_MeshProcess_DeleteArray(wrap_this)
}

/*
public InputGeom * * GetPtrToM_geom()
*/
func (p MeshProcessPtr) GetPtrToM_geom() *InputGeomPtr {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_MeshProcess_GetPtrToM_geom(wrap_this)
	go_out := (*InputGeomPtr)(unsafe.Pointer(wrap_out))
	return go_out
}

/*
MeshProcess * IndexArray(long n)
*/
func (p MeshProcessPtr) IndexArray(n int) uintptr {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_MeshProcess_IndexArray(wrap_this, C.long(n))
	go_out := uintptr(wrap_out)
	return go_out
}

/*
public void init(InputGeom * geom)
*/
func (p MeshProcessPtr) Init(geom InputGeomPtr) {
	var wrap_this unsafe.Pointer
	var wrap_arg_geom unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_arg_geom = (unsafe.Pointer)(geom)
	C.nav_MeshProcess_init(wrap_this, wrap_arg_geom)
}

/*
public MeshProcess()
*/
func NewMeshProcess() cgo.GoManagedPtr[MeshProcessPtr] {
	wrap_out := C.nav_NewMeshProcess()
	go_out := cgo.MakePtr[cgo.GoManagedPtr[MeshProcessPtr]](uintptr(wrap_out))
	return go_out
}

/*
public virtual void process(dtNavMeshCreateParams * params, unsigned char * polyAreas, unsigned short * polyFlags)
*/
func (p MeshProcessPtr) Process(params DtNavMeshCreateParamsPtr, polyAreas *uint8, polyFlags *uint16) {
	var wrap_this unsafe.Pointer
	var wrap_arg_params unsafe.Pointer
	var wrap_arg_polyAreas unsafe.Pointer
	var wrap_arg_polyFlags unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_arg_params = (unsafe.Pointer)(params)
	wrap_arg_polyAreas = (unsafe.Pointer)(polyAreas)
	wrap_arg_polyFlags = (unsafe.Pointer)(polyFlags)
	C.nav_MeshProcess_process(wrap_this, wrap_arg_params, wrap_arg_polyAreas, wrap_arg_polyFlags)
}

/*
FastLZCompressor * NewFastLZCompressorPtrArray(long n)
*/
func NewFastLZCompressorPtrArray(n int) cgo.GoManagedPtr[cgo.Array[FastLZCompressorPtr]] {
	wrap_out := C.nav_NewFastLZCompressorPtrArray(C.long(n))
	go_out := cgo.MakePtr[cgo.GoManagedPtr[cgo.Array[FastLZCompressorPtr]]](uintptr(wrap_out))
	return go_out
}

/*
MeshProcess * NewMeshProcessPtrArray(long n)
*/
func NewMeshProcessPtrArray(n int) cgo.GoManagedPtr[cgo.Array[MeshProcessPtr]] {
	wrap_out := C.nav_NewMeshProcessPtrArray(C.long(n))
	go_out := cgo.MakePtr[cgo.GoManagedPtr[cgo.Array[MeshProcessPtr]]](uintptr(wrap_out))
	return go_out
}
